<template>
    <el-tabs v-model="activeTab">
        <el-tab-pane label="帐号" name="account">
            <account :usage="1"></account>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="采集目标" name="source">
            <SpiderSource></SpiderSource>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="采集规则" name="rule">
            <SpiderRuleList></SpiderRuleList>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="采集任务" name="task">
            <SpiderTask :usage="1"></SpiderTask>
        </el-tab-pane>
        <el-tab-pane :lazy=true label="采集计划" name="job">
            <SpiderJobList></SpiderJobList>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
const { ipcRenderer: ipc } = require('electron')
import { UsageScope } from "@/entities/Constant"

import Account from "@/views/media/common/Account"
import SpiderTask from "@/views/media/spider/spiderTask"
import SpiderSource from "@/views/media/spider/spiderSource"
import SpiderJobList from "@/views/media/spider/spiderJobList"
import SpiderRuleList from "@/views/media/spider/spiderRuleList"
export default {
    name: "Spider",
    components: {
        Account,
        SpiderTask,
        SpiderSource,
        SpiderJobList,
        SpiderRuleList,
    },
    data() {
        return {
            activeTab: "account",
        }
    },
    methods: {
        handleCrawle(row) {
            ipc.send("puppeteer", { usageScope: UsageScope.Ai, data: row, raw: 1 })
        }
    },
}
</script>
